package org.example.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Author: Edward
 * @Date:2022-08-31 9:36
 * @subject:
 */

//@Data //为当前实体类的属性自动添加getter和setter和toString方法
//@NoArgsConstructor //生成一个无参的构造方法
//@AllArgsConstructor //生成一个包含所有属性的有参构造方法
public class Target {
    private Integer tId;
    private String tName;
    @DateTimeFormat(pattern = "yyyy-MM-dd")  //处理前端传过来的参数格式转换
    @JsonFormat(pattern = "yyyy-MM-dd")  //要将一个日期类型以指定格式显示
    private Date tDate;
    private String tInfo;
    private String mName;

    public Integer gettId() {
        return tId;
    }

    public void settId(Integer tId) {
        this.tId = tId;
    }

    public String gettName() {
        return tName;
    }

    public void settName(String tName) {
        this.tName = tName;
    }

    public Date gettDate() {
        return tDate;
    }

    public void settDate(Date tDate) {
        this.tDate = tDate;
    }

    public String gettInfo() {
        return tInfo;
    }

    public void settInfo(String tInfo) {
        this.tInfo = tInfo;
    }

    public String getmName() {
        return mName;
    }

    public void setmName(String mName) {
        this.mName = mName;
    }

    public Target() {
    }

    public Target(Integer tId, String tName, Date tDate, String tInfo, String mName) {
        this.tId = tId;
        this.tName = tName;
        this.tDate = tDate;
        this.tInfo = tInfo;
        this.mName = mName;
    }

    @Override
    public String toString() {
        return "Target{" +
                "tId=" + tId +
                ", tName='" + tName + '\'' +
                ", tDate=" + tDate +
                ", tInfo='" + tInfo + '\'' +
                ", mName='" + mName + '\'' +
                '}';
    }
}
